package com.yuanxiao.impl;

import com.yuanxiao.dao.TokenDao;
import com.yuanxiao.pojo.AuthToken;
import com.yuanxiao.service.UserService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;


@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private TokenDao tokenDao;
    @Override
    public String getEmail(String token) {
        AuthToken byToken = tokenDao.findByToken(token);
        if (byToken != null){

            return byToken.getEmail();
        }
        return "token is no auth";
    }
}
